<%@ Register TagPrefix="uc2" TagName="header1" Src="~/webControls/adm_header.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="adm_uploadfile.aspx.vb" Inherits="georgia_globaltp.uploadfile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>upload_prodimages</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script language="javascript">
var URL = "";

function showimage(imagefile)
{
  URL = "showimage.asp?target=" + imagefile;
  var win = window.open(URL, 'imagewindow', 'width=300,height=300,toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no');
  win.focus();
}
		
	
		function validateform(){ var csvtype = document.main.csvtype.value; var csvpath 
		= document.main.filepath.value;
		<script language="javascript">  
  if(csvtype==""){
   alert('Please select an Adjustment Type.');
   return false;
  }else if(csvpath==""){
  alert('Please proceed to Step 2. and select a file for uploading.');
  return false;
  }else{
   return validatefiletype(csvpath);
  }
}
function setadjtype(xitem){
   document.main.csvtype.value=xitem
}
function validatefiletype(xitem){
   var strPath = new String(xitem);
   var arrPath = strPath.split("\\");
   var filename = arrPath[arrPath.length-1];
   var strExt = new String(filename);
   var arrExt = strExt.split(".");
   var extname = arrExt[arrExt.length-1];
   
   if(extname=="csv" || extname=="CSV"){
		return true;
   }else{
		var msg = "You attempting to upload an invalid file type. Valid file types will ";
		msg += "will have an extension of \"csv\"." 
		alert(msg);
		return false;
   }
}
		</script>
	</HEAD>
	<body>
		<table cellSpacing="0" cellPadding="0" width="100%" border="0">
			<tr>
				<td id="header" colSpan="2"></td>
			</tr>
		</table>
		<table border="0" cellspacing="0" cellpadding="2" bgcolor="#f0f0f0" width="400">
			<tr>
				<td colspan="2" bgcolor="#ffffff"><hr size="1" width="100%">
				</td>
			</tr>
			<form id="main" enctype="multipart/form-data" runat="server">
				<div align="center">
					<font face="Arial" size="5"><b>Upload Products Photo and File</b></font><br>
				</div>
				<br>
				<div class="msg2">
					Each csv file must consist of <b>only one</b> adjustment type, i.e. one file 
					per <b>division</b>-<b>year</b>-<b>period</b>.
				</div>
		</table>
		<table width="100%" border="0" cellpadding="3" align="center">
			<tr>
				<td colspan="3" class="grad_2"><asp:Label ID="lblStepOne" Runat="server" CssClass="tblhead">1. Select upload type</asp:Label></td>
			</tr>
			<tr>
				<td>
					<asp:RadioButtonList id="CsvTypeButtonList" runat="server" CssClass="msg2" Width="264px">
						<asp:ListItem Value="gmbl_">ProductPhoto</asp:ListItem>
						<asp:ListItem Value="plnadj_">Product File</asp:ListItem>
						<asp:ListItem Value="lckstkadj_">Company Logo</asp:ListItem>
					</asp:RadioButtonList>
				</td>
			</tr>
			<tr>
				<td colspan="3" class="grad_2"><asp:Label ID="lblStepTwo" Runat="server" CssClass="tblhead">2. Upload CSV file</asp:Label></td>
			</tr>
			<tr>
				<td>
					<input id="inpFileUp" type="file" runat="server" NAME="inpFileUp">
				</td>
			</tr>
			<tr>
				<td><asp:Label id="lblError" runat="server" CssClass="msg"></asp:Label></td>
			</tr>
			<tr>
				<td><hr>
				</td>
			</tr>
			<tr>
				<td align="center">
					<!--<input type="submit" value="Validate File">-->
					<asp:Button id="btnValidate" runat="server" Text="Validate File"></asp:Button>
				</td>
			</tr>
		</table>
		</TD></TR></TABLE></FORM></TABLE>
	</body>
</HTML>
